package com.xa.xamall.framework.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 树形结点实体类
 */
public class TreeNode implements Serializable {

    /**
     * 序列化编号
     */
    private static final long serialVersionUID = -3537665208435554949L;

    /**
     * 节点编号
     */
    private int id = 0;

    /**
     * 父节点编号
     */
    private int parentId = 0;

    /**
     * 子级深度
     */
    private int depth = 0;

    /**
     * 节点名称
     */
    private String name = "";

    /**
     * 节点类型，枚举值
     */
    private int nodeType = 0;

    /**
     * 是否启用
     */
    private boolean useful = true;

    /**
     * 子节点数据集合
     */
    private List<TreeNode> children = new ArrayList<>();

    /**
     * 树形节点信息
     */
    private String nodeInfo = "";


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public int getDepth() {
        return depth;
    }

    public void setDepth(int depth) {
        this.depth = depth;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getNodeType() {
        return nodeType;
    }

    public void setNodeType(int nodeType) {
        this.nodeType = nodeType;
    }

    public boolean getUseful() {
        return useful;
    }

    public void setUseful(boolean useful) {
        this.useful = useful;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    public String getNodeInfo() {
        return nodeInfo;
    }

    public void setNodeInfo(String nodeInfo) {
        this.nodeInfo = nodeInfo;
    }


    public TreeNode(int id, int parentId, String name, boolean useful) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.useful = useful;
    }

    public TreeNode(int id, int parentId, String name, int nodeType, boolean useful) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.nodeType = nodeType;
        this.useful = useful;
    }
}
